# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Arnaud Taffanel <dev@taffanel.org>
# Contributor: Victor Häggqvist <aur a snilius d com>

_name=Solaar
pkgname=solaar
pkgver=1.1.9
pkgrel=2
pkgdesc="Linux device manager for a wide range of Logitech devices"
url="https://pwr-solaar.github.io/Solaar/"
license=('GPL2')
arch=('any')
depends=(
  gtk3 libnotify
  python-{dbus,evdev,gobject,hid-parser,psutil,pyudev,xlib,yaml}
)
makedepends=(git python-build python-installer python-setuptools python-wheel)
optdepends=('libayatana-appindicator: Display tray icon')
source=("git+https://github.com/pwr/${_name}.git#tag=${pkgver}?signed")
sha512sums=('SKIP')
validpgpkeys=('2FF2ACA9D97FF7B42CF8494A1E32E75672D6A196') # Peter F. Patel-Schneider (key generated for github) <pfpschneider@gmail.com>

prepare() {
  cd ${_name}
  tools/po-compile.sh
}

build() {
  cd ${_name}
  python -m build --wheel --no-isolation
}

package() {
  cd ${_name}
  python -m installer --destdir="$pkgdir" dist/*.whl

  # udev
  rm -rf "${pkgdir}/etc"
  install -vDm 644 rules.d/42-logitech-unify-permissions.rules \
    -t "${pkgdir}/usr/lib/udev/rules.d/"
  # docs
  install -vDm 644 {ChangeLog.md,README.md} \
    -t "${pkgdir}/usr/share/doc/${pkgname}/"
}
# vim:set ts=2 sw=2 et:
